package com.demo.gulimall.ware.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 购物车中每个项目
 * @author Chen Yuan
 * @create 2023-06-19  10:16
 */
@Data
@Accessors(chain = true)
public class OrderItemVo implements Serializable {

	private Long skuId;

	private String title;

	private String image;
	// 商品属性列表
	private List<String> skuAttrs;

	private BigDecimal price;

	private Integer count;

	private BigDecimal totalPrice;

	private Boolean hasStock;

	// 计算当前项目总价
	public BigDecimal getTotalPrice(){
		return this.price.multiply(new BigDecimal(count));
	}
}
